<?php

/**
 * Document form base class.
 *
 * @method Document getObject() Returns the current form's model object
 *
 * @package    erpcrm
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseDocumentForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'document_iden' => new sfWidgetFormInputHidden(),
      'document_date' => new sfWidgetFormDate(),
      'document_type' => new sfWidgetFormInputText(),
      'void'          => new sfWidgetFormInputText(),
      'void_date'     => new sfWidgetFormDateTime(),
      'owner_iden'    => new sfWidgetFormPropelChoice(array('model' => 'AccountOwner', 'add_empty' => false)),
      'counter_code'  => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'document_iden' => new sfValidatorPropelChoice(array('model' => 'Document', 'column' => 'document_iden', 'required' => false)),
      'document_date' => new sfValidatorDate(),
      'document_type' => new sfValidatorString(array('max_length' => 20)),
      'void'          => new sfValidatorString(array('max_length' => 1)),
      'void_date'     => new sfValidatorDateTime(array('required' => false)),
      'owner_iden'    => new sfValidatorPropelChoice(array('model' => 'AccountOwner', 'column' => 'contact_iden')),
      'counter_code'  => new sfValidatorString(array('max_length' => 10)),
    ));

    $this->widgetSchema->setNameFormat('document[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Document';
  }


}
